﻿var status = 0;
var z = "#fUI/UIWindow/Quest/icon5/1#";//"+z+"//美化

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        im.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (status == 0) {
        var selStr = "#e#r请认真选择下面的装备,选错后果自负#k#n\r\n";
		selStr += "#L1##b"+z+"暴君西亚戴斯腰带#l\r\n";
		selStr += "#L2##b"+z+"暴君赫尔梅斯腰带#l\r\n";
		selStr += "#L3##b"+z+"暴君凯伦腰带#l\r\n";
		selStr += "#L4##b"+z+"暴君利卡昂腰带#l\r\n";
		selStr += "#L5##b"+z+"暴君阿尔泰腰带#l\r\n";
		selStr += "#L6##b"+z+"暴君西亚戴斯披风#l\r\n";
		selStr += "#L7##b"+z+"暴君赫尔梅斯披风#l\r\n";
		selStr += "#L8##b"+z+"暴君凯伦披风#l\r\n";
		selStr += "#L9##b"+z+"暴君利卡昂披风#l\r\n";
		selStr += "#L10##b"+z+"暴君阿尔泰披风#l\r\n";
		selStr += "#L11##b"+z+"暴君西亚戴斯手套#l\r\n";
		selStr += "#L12##b"+z+"暴君赫尔梅斯手套#l\r\n";
		selStr += "#L13##b"+z+"暴君凯伦手套#l\r\n";
		selStr += "#L14##b"+z+"暴君利卡昂手套#l\r\n";
		selStr += "#L15##b"+z+"暴君阿尔泰手套#l\r\n";
		selStr += "#L16##b"+z+"暴君西亚戴斯靴#l\r\n";
		selStr += "#L17##b"+z+"暴君赫尔梅斯靴#l\r\n";
		selStr += "#L18##b"+z+"暴君凯伦靴#l\r\n";
		selStr += "#L19##b"+z+"暴君利卡昂靴#l\r\n";
		selStr += "#L20##b"+z+"暴君阿尔泰靴#l\r\n";
        im.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
		case 1:
            	im.gainItem(1132174,1);
				im.gainItem(2432069,-1);
                                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
		case 2:
            	im.gainItem(1132175,1);
				im.gainItem(2432069,-1);
                                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 3:
            	im.gainItem(1132176,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 4:
            	im.gainItem(1132177,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 5:
            	im.gainItem(1132178,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 6:
            	im.gainItem(1102481,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 7:
            	im.gainItem(1102482,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 8:
            	im.gainItem(1102483,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 9:
            	im.gainItem(1102484,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 10:
            	im.gainItem(1102485,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 11:
            	im.gainItem(1082543,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 12:
            	im.gainItem(1082544,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 13:
            	im.gainItem(1082545,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 14:
            	im.gainItem(1082546,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 15:
            	im.gainItem(1082547,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 16:
            	im.gainItem(1072743,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 17:
            	im.gainItem(1072744,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 18:
            	im.gainItem(1072745,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 19:
            	im.gainItem(1072746,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
			case 20:
            	im.gainItem(1072747,1);
				im.gainItem(2432069,-1);
                im.worldSpouseMessage(0x20, "『自选箱子』 : 恭喜 " + im.getPlayer().getName() + " 通过充值箱子获得自选暴君一件。");
				im.dispose();
            break;
        }
    }
}
